<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<style>
		.input-text {width: 460px;}
	</style>
</head>

<body>
	<div class="wrapper">
		<div id="btnDiv">
			<a href="<c:url value="/bug/openOperate.do?op=create&fromStatus=0" />" class="btn">新建缺陷</a>
		</div>
		
		<div id="listDiv">
			<table id="bugTab" class="list-table">
				<tr>
					<th width="60px">序号</th>
					<th width="400px">名称</th>
					<th width="150px">所属项目</th>
					<th width="100px">状态</th>
					<th width="150px">责任人</th>
					<th width="150px">最近更新时间</th>
				</tr>
			</table>
		</div>
	</div>
	
	<script>
		_remoteCall("bug/getBugs.do", null, function(data) {
			var info = eval(data), html = "";
			
			for(var i in info) {
				html += "<tr id='" + info[i].id + "'>";
				html += "<td class='sn'>" + (parseInt(i) + 1) + "</td>";
				html += "<td><div class='auto-link'><a href='#' onclick='openBug($(this));return false;'>" + info[i].name + "</a></div></td>";
				html += "<td><div>" + info[i].projectName + "</div></td>";
				html += "<td><div>" + info[i].statusName + "</div></td>";
				html += "<td><div>" + info[i].owner + "</div></td>";
				html += "<td><div>" + getTimeStr(info[i].modifyTime) + "</div></td>";
				html += "</tr>";
			}
			
			$("#bugTab").append(html);
		});
		
		function openBug($a) {
			var id = $a.closest("tr").attr("id");
			location.href = parent.basePath + "bug/openBug.do?bugId=" + id;
		}
	</script>
</body>
</html>
